package cn.dust.design.pattern.creational.singleton;

/**
 * @Author: dust
 * @Date: 2019/11/25 19:50
 */
public class LazyDoubleCheckSingleton {
    private volatile static LazyDoubleCheckSingleton lazyDoubleCheckSingleton=null;
    private LazyDoubleCheckSingleton(){
    }

    public static LazyDoubleCheckSingleton getInstance(){
        if(lazyDoubleCheckSingleton==null){
            synchronized (LazyDoubleCheckSingleton.class){
                if(lazyDoubleCheckSingleton==null){
                    lazyDoubleCheckSingleton= new LazyDoubleCheckSingleton();
                    //分配内存
                    //初始化对象
                    //设置lazyDoubleCheckSingleton指向内存
                }
            }
        }
        return lazyDoubleCheckSingleton;
    }


}
